from enum import Enum


class Vip(Enum):
    YELLOW = 1
    GREEN = 2
    BLACK = 3
    RED = 4


# 枚举可做等值比较
# re = Vip.YELLOW == Vip.GREEN
# print(re)
# 枚举不可做大小比较
# re2 = Vip.YELLOW < Vip.GREEN
# print(re2)
# 枚举可做身份比较
# re3 = Vip.YELLOW is Vip.YELLOW
# print(re3)

# 不同标签设置相同的值会被认为是别名
# print(Vip.GREEN)

#  枚举的转换
a = 2
print(Vip(a))
